﻿using System.Reflection;
using Abp.Application.Services;
using Abp.Configuration.Startup;
using Abp.Modules;
using Abp.WebApi;
using Abp.Web.Models;

namespace STOWaybillMall
{
    [DependsOn(typeof(AbpWebApiModule), typeof(STOWaybillMallApplicationModule))]
    public class STOWaybillMallWebApiModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

            Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(STOWaybillMallApplicationModule).Assembly, "app")
                .WithConventionalVerbs()
                   //.ForMethods(builder =>
                   //{
                   //    builder.Verb = Abp.Web.HttpVerb.Get;
                   //})
                .Build();
            //Configuration.Modules.AbpWebApi().DefaultDynamicApiWrapResultAttribute.WrapOnSuccess = false;
            //Configuration.Modules.AbpWebApi().DefaultDynamicApiWrapResultAttribute.WrapOnError = false;
        }
    }
}
